package cn.wolfcode.trip.admin.Controller;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IUserService;
import cn.wolfcode.trip.base.util.JSONResult;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController  {

    @Autowired
    private IUserService userService;

    /**
     * 查出所有注册用户
     * @param qo
     * @param model
     * @return
     */
    @RequestMapping("/list")
    public  String list(@ModelAttribute("qo") QueryObject qo, Model model){
        PageInfo<User> pageInfo=userService.query(qo);
        model.addAttribute("pageInfo",pageInfo);
        return "user/list";
    }


}
